#include "tcpClient.hpp"

#include <memory>
#include <cstdio>

#include "log.hpp"

using namespace Client;
using namespace std;

// 使用手册
static void Usage(std::string proc){
    std::cerr << "\nUsage:\n\t" << proc << "serverip serverport\n\n" << std::endl;
}

// ./tcpClient serverip serverport
int main(int argc, char* argv[]){
    if(argc != 3){
        Usage(argv[0]);
        exit(USAGE_ERROR);   
    }
    std::string serverip = argv[1];
    uint16_t serverport = atoi(argv[2]);

    std::unique_ptr<tcpClient> tcli(new tcpClient(serverip, serverport));
    tcli->initClient();
    tcli->start();

    return 0;
}